+function(){
	$('body').on('click', '#emadd', function(event) {
		var flag = true;
      $('input:not([type=button]),.YYYY,.MM,.DD').each(function(index, el) {
        if($(this).val()==''){
          $(this).css('border', '3px solid #f77');
					flag = false;
          alert('请将信息补充完整');
					return false;
        }
        $(this).attr('style', ' ');
      });
			if(flag == false){
				return false;
			}
      var emintime =   $('select[name="intime-YYYY"]').val()+'-'+$('select[name="intime-MM"]').val()+'-'+$('select[name="intime-DD"]').val();
      var embirth =   $('select[name="birth-YYYY"]').val()+'-'+$('select[name="birth-MM"]').val()+'-'+$('select[name="birth-DD"]').val();
      var postdata = {
  				emname: $('#emname').val(),
  				embrand: $('#embrand').val(),
  				emtel: $('#emtel').val(),
  				emposition: $('#emposition').val(),
  				emintime: emintime,
  				embirth: embirth,
  				emaddr: $('#emaddr').val()
      }
			$.post('/employee/employee_add_go', postdata, function(data) {
				if (data != 'false') {
					alert('添加成功');
				} else {
					alert('添加失败');
				}
			});
	});
}(jQuery);
